<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: CSMA802154 Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00068.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">CSMA802154 Class Reference<div class="ingroups"><a class="el" href="a00509.html">macLayer - MAC layer modules</a> &#124; <a class="el" href="a00525.html">CSMA - Classes for the CSMA implementation of MiXiM</a> &#124; <a class="el" href="a00523.html">IEEE 802.15.4 - Classes for the IEEE 802.15.4 implementation of MiXiM</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="CSMA802154" --><!-- doxytag: inherits="csma" -->
<p>Extends "csma" module by some statistics send up to the upper layer.  
 <a href="a00068.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00428_source.html">CSMA802154.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for CSMA802154:</div>
<div class="dyncontent">
<div class="center"><img src="a00685.png" border="0" usemap="#CSMA802154_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for CSMA802154:</div>
<div class="dyncontent">
<div class="center"><img src="a00686.png" border="0" usemap="#CSMA802154_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00687.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00068.html#abbb7175c6f28345ca29c3ca6f98732fc">initialize</a> (int stage)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of the module and some variables.  <a href="#abbb7175c6f28345ca29c3ca6f98732fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual cPacket *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00068.html#ab2174202ba00f0731fc9924597aba925">decapsMsg</a> (macpkt_ptr_t macPkt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">decapsulate the network message from the MacPkt  <a href="#ab2174202ba00f0731fc9924597aba925"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f0003b6596ef17341a93f06397d741e"></a><!-- doxytag: member="CSMA802154::handleLowerControl" ref="a0f0003b6596ef17341a93f06397d741e" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00068.html#a0f0003b6596ef17341a93f06397d741e">handleLowerControl</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from lower layer. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Extends "csma" module by some statistics send up to the upper layer. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Jerome Rousselot, Amre El-Hoiydi, Marc Loebbers, Yosia Hadisusanto, Andreas Koepke </dd>
<dd>
Karl Wessel (port for MiXiM) </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab2174202ba00f0731fc9924597aba925"></a><!-- doxytag: member="CSMA802154::decapsMsg" ref="ab2174202ba00f0731fc9924597aba925" args="(macpkt_ptr_t macPkt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cPacket * CSMA802154::decapsMsg </td>
          <td>(</td>
          <td class="paramtype">macpkt_ptr_t&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>decapsulate the network message from the MacPkt </p>
<p>Decapsulates the network packet from the received MacPkt </p>

<p>Reimplemented from <a class="el" href="a00067.html#aedcaefc83f850c1ca35836cb223b412e">csma</a>.</p>

<p>References <a class="el" href="a00077.html#aa30be9038f1da2e0e56527b6b307d1ff">DeciderResult802154Narrow::getBER()</a>, <a class="el" href="a00177.html#a695fcb4091796018a3315486acafc9b0">PhyToMacControlInfo::getDeciderResult()</a>, <a class="el" href="a00077.html#a4f0b52a07c37da3fdbcd44cc20f7cca1">DeciderResult802154Narrow::getRSSI()</a>, <a class="el" href="a00132.html#ac893214f0521cb356739841c63f1c498">MacToNetwControlInfo::setBitErrorRate()</a>, and <a class="el" href="a00132.html#ac912ee19746ecde01512876568c95839">MacToNetwControlInfo::setRSSI()</a>.</p>
<div class="fragment"><pre class="fragment">                                                  {

  cPacket * msg = <a class="code" href="a00068.html#ab2174202ba00f0731fc9924597aba925" title="decapsulate the network message from the MacPkt">csma::decapsMsg</a>(macPkt);

  <span class="comment">// get bit error rate</span>
  <a class="code" href="a00177.html" title="Controlinfo for packets which are send from Physical layer to the MAC layer.">PhyToMacControlInfo</a>* cinfo = <span class="keyword">static_cast&lt;</span><a class="code" href="a00177.html" title="Controlinfo for packets which are send from Physical layer to the MAC layer.">PhyToMacControlInfo</a>*<span class="keyword">&gt;</span> (macPkt-&gt;getControlInfo());
  <span class="keyword">const</span> <a class="code" href="a00077.html" title="Defines an extended DeciderResult for the 802.15.4 protocol.">DeciderResult802154Narrow</a>* result = <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><a class="code" href="a00077.html" title="Defines an extended DeciderResult for the 802.15.4 protocol.">DeciderResult802154Narrow</a>*<span class="keyword">&gt;</span> (cinfo-&gt;<a class="code" href="a00177.html#a695fcb4091796018a3315486acafc9b0" title="Returns the result of the evaluation of the Decider.">getDeciderResult</a>());
  <span class="keywordtype">double</span> ber = result-&gt;<a class="code" href="a00077.html#aa30be9038f1da2e0e56527b6b307d1ff" title="Returns the bit error rate of the transmission.">getBER</a>();
  <span class="keywordtype">double</span> rssi = result-&gt;<a class="code" href="a00077.html#a4f0b52a07c37da3fdbcd44cc20f7cca1" title="Returns the received signal strength of the transmission.">getRSSI</a>();

  <span class="comment">//get control info attached by base class decapsMsg method</span>
  <span class="comment">//and set its rssi and ber</span>
  assert(dynamic_cast&lt;MacToNetwControlInfo*&gt;(msg-&gt;getControlInfo()));
  <a class="code" href="a00132.html" title="Stores control information from mac to upper layer.">MacToNetwControlInfo</a>* cInfo = <span class="keyword">static_cast&lt;</span><a class="code" href="a00132.html" title="Stores control information from mac to upper layer.">MacToNetwControlInfo</a>*<span class="keyword">&gt;</span>(msg-&gt;getControlInfo());
  cInfo-&gt;<a class="code" href="a00132.html#ac893214f0521cb356739841c63f1c498" title="Sets the bit error rate for this control infos packet.">setBitErrorRate</a>(ber);
  cInfo-&gt;<a class="code" href="a00132.html#ac912ee19746ecde01512876568c95839" title="Sets the packets received signal strength.">setRSSI</a>(rssi);

  <span class="keywordflow">return</span> msg;
}
</pre></div>
</div>
</div>
<a class="anchor" id="abbb7175c6f28345ca29c3ca6f98732fc"></a><!-- doxytag: member="CSMA802154::initialize" ref="abbb7175c6f28345ca29c3ca6f98732fc" args="(int stage)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CSMA802154::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stage</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialization of the module and some variables. </p>
<p>Initialize the of the omnetpp.ini variables in stage 1. In stage two subscribe to the RadioState. </p>

<p>Reimplemented from <a class="el" href="a00067.html#a24e7a48bd1d9036139c75b558ade4161">csma</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="code" href="a00068.html#abbb7175c6f28345ca29c3ca6f98732fc" title="Initialization of the module and some variables.">csma::initialize</a>(stage);
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/mac/<a class="el" href="a00428_source.html">CSMA802154.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/mac/CSMA802154.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00068.html">CSMA802154</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
